package com.example.szh.adapter;

import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.example.szh.R;
import com.example.szh.entity.FollowEntity;
import com.example.szh.utils.LoadImage;

import org.greenrobot.greendao.annotation.NotNull;


public class FollowNewsAdapter extends BaseQuickAdapter<FollowEntity.Values, BaseViewHolder> {
    public FollowNewsAdapter() {
        super(R.layout.item_follow);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder baseViewHolder, FollowEntity.Values values) {
        baseViewHolder.setText(R.id.follow_item_name_tv,values.author_name);
        baseViewHolder.setText(R.id.follow_item_value_tv,values.author_attestation);
        baseViewHolder.setText(R.id.follow_item_title,values.news_title);
        baseViewHolder.setText(R.id.follow_item_time,""+values.news_time);
        ImageView headImg = baseViewHolder.getView(R.id.follow_item_head_img);
        ImageView img = baseViewHolder.getView(R.id.follow_item_img);
        LoadImage.loadCircleImg(values.author_img,headImg);
        LoadImage.loadMatchImg(values.medias.get(0).media_url,img);
    }
}
